<h3>
    <i class="icon-comments-alt"></i> <span translate>Discussion</span>
</h3>

<p ng-if="timeline_controller.timeline.length === 0 && ! timeline_controller.loading_timeline"
    class="empty"
    translate
>
    Discussion has not started yet
</p>

<ul>
    <li class="pull-request-event"
        ng-repeat="event in timeline_controller.timeline track by $index"
        ng-class="[event.type, { 'from-pr-author': event.isFromPRAuthor, 'is-outdated': event.is_outdated, 'inline-comment': event.isInlineComment }]">
        <div class="avatar">
            <img src="{{ event.user.avatar_url }}" class="media-object">
        </div>

        <div class="pull-request-event-content">
            <div class="pull-request-event-content-info">
                <a href="{{ event.user.user_url }}" class="pull-request-event-author">{{ event.user.display_name }}</a>
                <small class="pull-request-event-date" am-time-ago="event.post_date"></small>

                <span ng-if="event.isInlineComment" class="pull-request-event-file-path">
                    <a ng-if="! event.is_outdated" ui-sref="diff({id: {{ timeline_controller.pull_request.id }} , file_path: '{{ event.file_path }}'})">
                        <i class="icon-file-text-alt"></i> {{ event.file_path }}
                    </a>
                    <span ng-if="event.is_outdated"><i class="icon-file-text-alt"></i> {{ event.file_path }}</span>
                </span>
            </div>

            <p ng-bind-html="event.content"></p>
        </div>
    </li>
    <li class="clear"></li>

    <li ng-if="timeline_controller.loading_timeline" class="loading"></li>
</ul>

<form ng-submit="timeline_controller.addComment()">
    <textarea ng-model="timeline_controller.new_comment.content" placeholder="{{ 'Say something…' | translate }}"></textarea>
    <button type="submit" class="btn btn-primary" ng-disabled="timeline_controller.loading_timeline"><i class="icon-comment"></i> {{ 'Comment' | translate }}</button>
</form>
